<?php
/**
 * Description of Char
 *
 * @author chedim
 */
class oChar extends oClass
{
    protected $value;

    public function  __construct($val, $enc = 'utf-8')
    {
        if (!$val) {
            throw new eInvalidValue('null', get_class($this));
        }
        if ($enc == 'utf-8') 
            $this->value = mb_substr($val, 0, 1, $enc);
        else
            $this->value = substr($val, 0, 1);
    }

    public function value() {
        return($this->value);
    }

    public function  __toString()
    {
        return $this->value;
    }
}
?>
